class Demo1_code 
{
	public static void main(String[] args) 
	{
		//System.out.println("Hello World!");
		Student stu = new Student();
		stu.study();
	}
}

class Student
{
	private String name;
	private int age;

	public Student(){}

	public Student(String name,int age){
		this.name = name;
		this.age = age;
	}

	public void study(){
		System.out.print("success");
	}
	
	//构造代码块
	{
		study();
	}

	//静态代码块
	static {
		//随着类加载而加载，而且只执行1次
		//作用 给类初始化 一般用来加载驱动
	}
}














